{% extends "base.html" %} {% block title %} 用户管理 {% endblock title %} {% block scripts %}
<script
    type="text/javascript"
    src="/medias/js/jquery-1.2.6.min.js"
></script>
<script
    type="text/javascript"
    src="/medias/js/jquery.tablesorter.min.js"
></script>
<script
    type="text/javascript"
    src="/medias/js/thickbox-compressed.js"
></script>
<link
    rel="stylesheet"
    href="/medias/thickbox.css"
    type="text/css"
    media="screen"
/>
<script type="text/javascript">
$(document).ready(function() {
						   $(".tablesorter").tablesorter({headers: { 7: { sorter: false }} }); 
});

function user_change_status(u_id){
	var m, u_id;
	u_id = u_id;
	m = '改变用的状态?\n\n用户被锁定后将不可登陆,但数据仍然有效.';
	if (window.confirm(m)){
		location.href='/user-manage/chstatus/'+u_id
		};
	}
	
function user_change_password(u_id){
	window.open('/user-manage/chpass/'+u_id, '_blank', 'width=420,height=250,menubar=no,toolbar=no,location=no,status=no,scrollbars=no,resizable=no')
	}
	
</script>
{% endblock scripts %} {% block content %}
<div class="meta">{% if is_paginated %} {% ifequal current_page 1 %} {% else %} <a href="?page=1"><img
    src="/medias/image/control_first.png"
    border="0"
    width="16"
    height="16"
    alt="转到第一页"
/></a> {% endifequal %} {% if has_previous %} <a href="?page={{ previous }}"><img
    src="/medias/image/control_rewind.png"
    border="0"
    width="16"
    height="16"
    alt="上一页"
/></a> {% else %} <img
    src="/medias/image/control_rewind.png"
    width="16"
    height="16"
    border="0"
    alt="上一页"
/> {% endif %} {% for p in page_numbers %} <a href="?page={{ p }}">{{ p }}</a> {% endfor %} {% if has_next %}<a href="?page={{ next }}"><img
    src="/medias/image/control_next.png"
    border="0"
    width="16"
    height="16"
    alt="下一页"
/></a> {% else %}<img
    src="/medias/image/control_next.png"
    border="0"
    width="16"
    height="16"
    alt="下一页"
/> {% endif %} {% ifequal current_page pages %}<img
    src="/medias/image/control_last.png"
    border="0"
    width="16"
    height="16"
    alt="转到最后一页"
/> {% else %} <a href="?page={{ pages }}"><img
    src="/medias/image/control_last.png"
    border="0"
    width="16"
    height="16"
    alt="转到最后一页"
/></a> {% endifequal %} &nbsp;&nbsp; 当前页：{{ page }}/{{ pages }} &nbsp;&nbsp; {% endif %} 共[&nbsp;{{ hits }}&nbsp;]个用户</div>
<form
    id="form1"
    name="form1"
    method="post"
    action=""
>
<table
    cellspacing="0"
    border="0"
    class="tablesorter"
    width=100%
>
    <caption>
    <h2>用户列表</h2>
    </caption>
    <thead>
        <tr>
            <th>用户名</th>
            <th>属组</th>
            <th>状态&nbsp;&nbsp;&nbsp;&nbsp;</th>
            <th>用户ID</th>
            <th>中文姓名</th>
            <th>用户创建时间</th>
            <th>最后登陆时间</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        {% for x in object_list %}
        <tr class="{% cycle odd,'' %}">
            <td><a href="/user-manage/detail/{{ x.id }}/">{{ x.username }}</a>&nbsp;</td>
            <td>
            <ul class="nopadding">
                {% block group %} {% for g in x.groups.all %}
                <li class="nopadding">{{ g.name|upper }}</li>
                {% endfor %} {% endblock %}
            </ul>
            </td>
            <td>{{ x.is_active|yesno:"正常,锁定,未知"}}&nbsp;</td>
            <td>{{ x.get_profile.user_unique_str|upper}}&nbsp;</td>
            <td>{{ x.get_profile.user_chinese_name }} &nbsp;</td>
            <td>{{ x.date_joined|date:"Y年 m月d日 H:i:s" }}&nbsp;</td>
            <td>{{ x.last_login|date:"Y年 m月d日 H:i:s" }}&nbsp;</td>
            <td><a
                href="javascript:void({{ x.id }})"
                title="改变用户[{{ x.username }}]的状态"
            ><img
                src="/medias/image/user_delete.png"
                width="16"
                height="16"
                border="0"
                alt="改变用户[{{ x.username }}]的状态"
                onclick="javascript:user_change_status({{ x.id }});"
            ></a>&nbsp; <a
                href="/user-manage/chpass/{{ x.id }}/?height=180&width=330&TB_iframe=true"
                class="thickbox"
                title="修改用户[{{ x.username }}]的密码"
            ><img
                src="/medias/image/user_password.png"
                width="16"
                height="16"
                border="0"
                alt="修改用户[{{ x.username }}]的密码"
            ></a>&nbsp; <a
                href="/user-manage/detail/{{ x.id }}"
                title="查看用户[{{ x.username }}]的信息"
            ><img
                src="/medias/image/user_edit.png"
                width="16"
                height="16"
                border="0"
                alt="查看用户[{{ x.username }}]的信息"
            ></a></td>
        </tr>
        {% endfor %}
    </tbody>
    <tfoot>
        <tr>
            <td colspan=20><img src="/medias/image/attach.png" />谨慎使用.用户删除后将不可恢复</td>
        </tr>
    </tfoot>
</table>
</form>
<div class="meta">{% if is_paginated %} {% ifequal current_page 1 %} {% else %} <a href="?page=1"><img
    src="/medias/image/control_first.png"
    border="0"
    width="16"
    height="16"
    alt="转到第一页"
/></a> {% endifequal %} {% if has_previous %} <a href="?page={{ previous }}"><img
    src="/medias/image/control_rewind.png"
    border="0"
    width="16"
    height="16"
    alt="上一页"
/></a> {% else %} <img
    src="/medias/image/control_rewind.png"
    width="16"
    height="16"
    border="0"
    alt="上一页"
/> {% endif %} {% for p in page_numbers %} <a href="?page={{ p }}">{{ p }}</a> {% endfor %} {% if has_next %}<a href="?page={{ next }}"><img
    src="/medias/image/control_next.png"
    border="0"
    width="16"
    height="16"
    alt="下一页"
/></a> {% else %}<img
    src="/medias/image/control_next.png"
    border="0"
    width="16"
    height="16"
    alt="下一页"
/> {% endif %} {% ifequal current_page pages %}<img
    src="/medias/image/control_last.png"
    border="0"
    width="16"
    height="16"
    alt="转到最后一页"
/> {% else %} <a href="?page={{ pages }}"><img
    src="/medias/image/control_last.png"
    border="0"
    width="16"
    height="16"
    alt="转到最后一页"
/></a> {% endifequal %} &nbsp;&nbsp; 当前页：{{ page }}/{{ pages }} &nbsp;&nbsp; {% endif %} 共[&nbsp;{{ hits }}&nbsp;]个用户</div>
{% endblock content %}
